import QtQuick 2.15
import QtQuick.Controls 2.15
import Qt5Compat.GraphicalEffects

Item {
	id: root
	property string source
	property alias radius: mask.radius
	
	Image {
		id: image
		anchors.centerIn: parent
		source: root.source
		width: parent.width
		height: parent.height
		fillMode: Image.PreserveAspectCrop
		smooth: true
		antialiasing: true
		visible: false
	}
	
	OpacityMask {
		anchors.fill: image
		source: image
		maskSource: mask
		visible: true
		antialiasing: true
	}
	Rectangle {
		id: mask
		anchors.fill: parent
		color: Qt.color('black')
		radius: 5
		visible: false
		antialiasing: true
		smooth: true
	}
}
